<template>
  <div class="footerbar">
    <span :class="{inside: !sidebar.opened, outside: sidebar.opened}">Copyright &copy 2018.Lenovo CBI</span>
  </div>
</template>

<script>
import {
  setQlikTicket,
  setQsurl,
  setQlikTestTicket,
  getQlikTestTicket,
  setTableAuTicket,
  getTableAuTicket,
  getUsername,
  setqlinkTkey,
  getToken
} from "../../../utils/auth";
import {mapGetters} from 'vuex'
export default {
  data() {
    return {
      getUsername: getUsername(),
      getToken: getToken(),
      product: {
        pgData: [],
        pgValue: [],
        finalBuData: [],
        finalBuValue: [],
        brandData: [],
        brandValue: [],
        seriesData: [],
        seriesValue: [],
        phProductData: [],
        phProductValue: []
      }
    }
  },
  methods:{
    loadProduct() {
      const _this = this;
      this.axios.post('/dropSelect/productSelect.do', {
        username: getUsername()
      }).then(res => {
        if (res.status === 200) {
          var resData = JSON.stringify(res.data.data)
          sessionStorage.setItem('productData', resData)
        }
      })
    },
    loadCustomer() {
      const _this = this
      this.axios.post('/dropSelect/customerSelect.do', {
        username: getUsername()
      }).then(res => {
        if (res.status === 200) {
          var resData = JSON.stringify(res.data.data)
          sessionStorage.setItem('customerData', resData)
        }
      })
    },

    toggleSideBar() {
      this.$store.dispatch('toggleSideBar')
    },
  },
  computed: {
    ...mapGetters([
      'sidebar'
    ])
  },
  mounted() {
    // this.loadProduct()
    // this.loadCustomer()
//     const _this = this;
//     setQsurl("http://10.122.33.93");
//     this.axios.get("/tableau/get_test_ticket").then(res => {
//       let data = res.data.data;
//       setTableAuTicket(data);
//     });
//     this.axios.post("/qlik/get_test_ticket").then(res => {
//       let data = res.data.data;
//       setQlikTestTicket(data);
//     });
//     this.axios.post("/qlik/get_ticket").then(res => {
//       let data = res.data.data;
//       setQlikTicket(data);
//     });
//      // this.axios.post(`/qlik/codata/get_ticket?user=${_this.getUsername}&userDir=LENOVOAD`).then(res => {
//      //   let data = res.data.data;
//      //   setqlinkTkey(data);
//      // });
// //    this.axios.post(`http://10.122.33.93:9191/get_ticket?user=${_this.getUsername}1&userDir=lenovoad`,`{this.getToken}`).then(res => {
// //      let data = res.data.data;
// //      setqlinkTkey(data);
// //    });
//     clearInterval(timer);
//     let timer = setInterval(function() {
//       _this.axios.post("/qlik/get_ticket").then(res => {
//         let data = res.data.data;
//         setQlikTicket(data);
//       });
//       _this.axios.get("/tableau/get_test_ticket").then(res => {
//         let data = res.data.data;
//         setTableAuTicket(data);
//       });
//       _this.axios.post("/qlik/get_test_ticket").then(res => {
//         let data = res.data.data;
//         setQlikTestTicket(data);
//       });
//      //   _this.axios.post(`/qlik/codata/get_ticket?user=${_this.getUsername}&userDir=LENOVOAD`).then(res => {
//      //   let data = res.data.data;
//      //   setqlinkTkey(data);
//      // });
// //    this.axios.post(`http://10.122.33.93:9191/get_ticket?user=${_this.getUsername}1&userDir=lenovoad`,`{this.getToken}`).then(res => {
// //      let data = res.data.data;
// //      setqlinkTkey(data);
// //    });
//     }, 100000);
  }
}
</script>

<style lang="scss" scoped>
.footerbar {
  width: 100%;
  height: 30px;
  background: #fff;
  text-align: center;
  font-size: 12px;
  text-align: center;
  line-height: 30px;
  .inside {
    /*margin-left: 85px;*/
    margin-left: 30px;
    transition: transform 0.1s ease-in-out, left 0.1s ease-in-out, margin-left 0.1s ease-in-out;
  }
  .outside {
    /*margin-left: 248px;*/
    margin-left: 200px;
    transition: transform 0.1s ease-in-out, left 0.1s ease-in-out, margin-left 0.1s ease-in-out;
  }
}
</style>
